package com.beta.cat.config.log;

import org.springframework.beans.BeansException;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Configuration
@ConditionalOnClass(name = "org.apache.logging.log4j.core.filter.AbstractFilter")
@Component
public class Log4j2SpringEnvSupportConfig implements ApplicationContextAware {
    public static ApplicationContext ctx;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        Log4j2SpringEnvSupportConfig.ctx = applicationContext;
    }
}
